package GUI;

import javax.swing.*;
import java.awt.*;

/**
 * @ClassName : JPanelDemo
 * @Author : LV88VL
 * @Date: 2021/3/25 17:15
 * @Description : JPanel类
 *              与JPanel方法基本一致，他是一个无边框，不能被移动，放大缩小的面板
 */
public class JPanelDemo {
    public static void main(String[] args) {
        JFrame jf =new JFrame("JPanelDemo");
        jf.setSize(300,200);
        jf.setLocation(200,300);
        JPanel panel =new JPanel();
        JButton btn1=new JButton("按钮1");
        JButton btn2=new JButton("按钮2");
        panel.add(btn1);
        panel.add(btn2);
        jf.add(panel);
        jf.setLayout(new FlowLayout());
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setVisible(true);
    }
}
